package cn.gqr;

import cn.gqr.dao.TypeDao;
import cn.gqr.entity.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class BlogWebApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext ioc = SpringApplication.run(BlogWebApplication.class, args);

        TypeDao type = ioc.getBean(TypeDao.class);
        if(type.getTypeAll()==null){
            type.add(new Type("Java",0));
            type.add(new Type("SpringBoot",0));
            type.add(new Type("Spring",0));
            type.add(new Type("Vue",0));
        }

    }

}
